{% load static %}
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
    <div class="container-fluid">
        <a class="navbar-brand" href="{% url 'home' %}">
            <i class="fas fa-map-marked-alt me-2"></i>
            旅游管理系统
        </a>

        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
            <span class="navbar-toggler-icon"></span>
        </button>

        <div class="collapse navbar-collapse" id="navbarNav">
            <ul class="navbar-nav me-auto">
                {% if request.user.is_authenticated %}
                    {% if request.user.user_type == 'admin' %}
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'accounts:admin_dashboard' %}">管理员面板</a>
                    </li>
                    {% elif request.user.user_type == 'culture' %}
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'accounts:culture_dashboard' %}">文旅面板</a>
                    </li>
                    {% else %}
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'accounts:user_dashboard' %}">用户面板</a>
                    </li>
                    {% endif %}
                {% endif %}
            </ul>

            <ul class="navbar-nav">
                {% if request.user.is_authenticated %}
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-bs-toggle="dropdown">
                        <i class="fas fa-user-circle me-1"></i>
                        {{ request.user.username }}
                    </a>
                    <ul class="dropdown-menu dropdown-menu-end">
                        <li><a class="dropdown-item" href="#">个人资料</a></li>
                        <li><hr class="dropdown-divider"></li>
                        <li><a class="dropdown-item" href="{% url 'logout' %}">退出登录</a></li>
                    </ul>
                </li>
                {% else %}
                <li class="nav-item">
                    <a class="nav-link" href="{% url 'login' %}">登录</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="{% url 'register' %}">注册</a>
                </li>
                {% endif %}
            </ul>
        </div>
    </div>
</nav>